package 实验四1;

public class Estimator {
    public static void main(String[] args) {
        double result;
        double[] a = {9.89, 9.88, 9.99, 9.12, 9.69, 9.76, 8.97};
        double[] b = {89, 56, 78, 90, 100, 77, 56, 45, 36, 79, 98};
        ComputerAverage computer;
        computer = new Gymnastics();
        result = computer.average(a);
        //【代码2】computer调用average（double x[])方法，将数组a传递给参数x
        System.out.printf("%n");
        System.out.printf("体操选手最后得分：%5.3f\n", result);
        computer = new School();
        result = computer.average(b);
        //【代码3】computer调用average（double x[])方法，将数组b传递给参数x
        System.out.printf("班级考试平均分数：%5.2f", result);

    }
}
